import argparse
import operator

parser = argparse.ArgumentParser()

parser.add_argument(
    '-i',
    action = 'store',
    dest = 'first_oprand',
    help = 'the first oprand',
    default = 0)

parser.add_argument(
    '-j',
    action = 'store',
    dest = 'second_oprand',
    help = 'the second oprand',
    default = 0)

parser.add_argument(
    '-o',
    action = 'store',
    dest = 'operator',
    help = 'the operator: limited to + - * /')

args = parser.parse_args()

a = int(args.first_oprand)
b = int(args.second_oprand)

ops = {'+': operator.add,
       '-': operator.sub,
       '*': operator.mul,
       '/': operator.div}

result = None
if args.operator == None:
    print "please specify the operator. now exit."
    exit()
else:
    op = ops.get(args.operator)
    if op != None:
        result = ops[args.operator](a,b)
    else:
        result = None

if result == None:
    print "unsupported operation: '%s'" % args.operator
else:
    print 'the result is %s' % result
